<?php
namespace Account\Model\Entity;

class Address {
	
    protected $id;
    protected $city;
    protected $country;
	protected $invalid;
	protected $latitude;
	protected $longtitude;
	protected $postalcode;
	protected $street1;
	protected $street2;
	protected $state;
	

    public function __construct(array $options = null) {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }
	
	public function exchangeArray($data)
	{
		$this->id = (isset($data['id'])) ? $data['id'] : null;
		$this->city = (isset($data['city'])) ? $data['city'] : null;
		$this->country = (isset($data['country'])) ? $data['country'] : null;
		$this->invalid = (isset($data['invalid'])) ? $data['invalid'] : null;
		$this->latitude = (isset($data['latitude'])) ? $data['latitude'] : null;
		$this->longtitude = (isset($data['longtitude'])) ? $data['longtitude'] : null;
		$this->postalcode = (isset($data['postalcode'])) ? $data['postalcode'] : null;
		$this->street1 = (isset($data['street1'])) ? $data['street1'] : null;
		$this->street2 = (isset($data['street2'])) ? $data['street2'] : null;
		$this->state = (isset($data['state'])) ? $data['state'] : null;
	}
	/*
    public function __set($id, $value) {
        $method = 'set' . $id;
        if (!method_exists($this, $method)) {
            throw new Exception('Invalid Method');
        }
        $this->$method($value);
    }

    public function __get($id) {
        $method = 'get' . $id;
        if (!method_exists($this, $method)) {
            throw new Exception('Invalid Method');
        }
        return $this->$method();
    }

    public function setOptions(array $options) {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }
*/
    public function getId() {
        return $this->_id;
    }

    public function setId($id) {
        $this->_id = $id;
        return $this;
    }

    public function getCity() {
        return $this->_city;
    }

    public function setCity($city) {
        $this->_city = $city;
        return $this;
    }

    public function getCountry() {
        return $this->_country;
    }

    public function setCountry($country) {
        $this->_country = $country;
        return $this;
    }
	
    public function getInvalid() {
        return $this->_invalid;
    }

    public function setInvalid($invalid) {
        $this->_invalid = $invalid;
        return $this;
    }
	
    public function getLatitude() {
        return $this->_latitude;
    }

    public function setLatitude($latitude) {
        $this->_latitude = $latitude;
        return $this;
    }
	
    public function getLongtitude() {
        return $this->_longtitude;
    }

    public function setLongtitude($longtitude) {
        $this->_longtitude = $longtitude;
        return $this;
    }
	
    public function getPostalCode() {
        return $this->_postalcode;
    }

    public function setPostalCode($postalcode) {
        $this->_postalcode = $postalcode;
        return $this;
    }
	
    public function getStreet1() {
        return $this->_street1;
    }

    public function setStreet1($street1) {
        $this->_street1 = $street1;
        return $this;
    }
	
	 public function getStreet2() {
        return $this->_street2;
    }

    public function setStreet2($street2) {
        $this->_street2 = $street2;
        return $this;
    }
	
	 public function getState() {
        return $this->_state;
    }

    public function setState($state) {
        $this->_state = $state;
        return $this;
    }
	
}

?>